/**
  * Created by yamei on 2017/7/26.
  */
object testing_string_equality {
  def main(args: Array[String]){
    val s1 = "hello"
    val s2 = "hello"
    val s3 = "h"+"ello"
    println(s1 == s2)
    println(s2 == s3)
    val s4:String = null
    println(s3 == s4)
    println("**************************")
    val s5 = "Hello"
    println(s1 == s5)
    println(s1.toUpperCase == s5.toUpperCase)//toUpperCase 将小写转为大写
    val s6:String = null
    //println(s6.toUpperCase) //注意null 不能做比较 转换否则会报错 java.lang.NullPointerException
    println("**************************")
    val a = "MALIANG"
    val b = "maliang"
    println(a.equalsIgnoreCase(b)) //equalsIgnoreCase(String:str) 忽略大小写的比较

  }

}
